package cn.exrick.xboot.modules.transport.entity;

import cn.exrick.xboot.base.XbootBaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author gj
 */
@Data
@Accessors(chain = true)
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "b_orders")
@TableName("b_orders")
@ApiModel(value = "订单表")
public class Orders extends XbootBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单编号")
    private String orderNumber;

    @ApiModelProperty(value = "订单状态，可选值：pendingPayment, placed, accepted, inTransit, transferring, arrived, received, completed, cancelled")
    private String status;

    @ApiModelProperty(value = "订单线路id")
    private Long routeId;

    @ApiModelProperty(value = "当前节点id")
    private Long currentNodeId;

    @ApiModelProperty(value = "下一节点id")
    private Long nextNodeId;

    @ApiModelProperty(value = "节点地图")
    private String nodeMap;

    @ApiModelProperty(value = "路线公里数")
    private Integer kilometers;

    @ApiModelProperty(value = "订单起运地区")
    private Long originRegionId;

    @ApiModelProperty(value = "订单起运地区名称")
    private String originRegionName;

    @ApiModelProperty(value = "订单起运详细地址")
    private String originAddress;

    @ApiModelProperty(value = "订单起运详细地址坐标")
    private String originAddressCoordinates;

    @ApiModelProperty(value = "订单目的地地区")
    private Long destinationRegionId;

    @ApiModelProperty(value = "订单目的地地区名称")
    private String destinationRegionName;

    @ApiModelProperty(value = "订单目的地详细地址")
    private String destinationAddress;

    @ApiModelProperty(value = "订单目的地详细地址坐标")
    private String destinationAddressCoordinates;

    @ApiModelProperty(value = "大客户id")
    private Long customerId;

    @ApiModelProperty(value = "发单人id")
    private Long senderId;

    @ApiModelProperty(value = "发货人姓名")
    private String senderName;

    @ApiModelProperty(value = "发货人手机号码")
    private String senderPhone;

    @ApiModelProperty(value = "收货人id")
    private Long receiverId;

    @ApiModelProperty(value = "收货人姓名")
    private String receiverName;

    @ApiModelProperty(value = "收货人手机号码")
    private String receiverPhone;

    @ApiModelProperty(value = "订单总金额")
    private BigDecimal orderAmount;

    @ApiModelProperty(value = "线路总金额")
    private BigDecimal routeAmount;

    @ApiModelProperty(value = "保险金额")
    private BigDecimal insuranceAmount;

    @ApiModelProperty(value = "优惠金额")
    private BigDecimal discountAmount;

    @ApiModelProperty(value = "起运地地跑金额")
    private BigDecimal originAmount;

    @ApiModelProperty(value = "目的地地跑金额")
    private BigDecimal destinationAmount;

    @ApiModelProperty(value = "订单扣款金额")
    private BigDecimal perOrderDeduction;

    @ApiModelProperty(value = "订单数量")
    private Integer quantity;

    @ApiModelProperty(value = "支付方式，可选值：PayNow, PayOnDelivery")
    private String paymentMethod;

    @ApiModelProperty(value = "支付人id")
    private Long paymentUser;

    @ApiModelProperty(value = "付款人，可选值：receiver ,sender")
    private String payerType;

    @ApiModelProperty(value = "支付状态 unpaid noPaymentNeeded paid")
    private String paymentStatus;

    @ApiModelProperty(value = "预留支付方式流水信息")
    private String payInfo;

    @ApiModelProperty(value = "退费流水信息")
    private String returnPayInfo;

    @ApiModelProperty(value = "实际支付金额")
    private BigDecimal actualPayment;

    @ApiModelProperty(value = "下单时间")
    private LocalDateTime orderTime;

    @ApiModelProperty(value = "支付时间")
    private LocalDateTime paymentTime;

    @ApiModelProperty(value = "确认接受操作人")
    private Long receiverUser;

    @ApiModelProperty(value = "接单时间")
    private LocalDateTime acceptanceTime;

    @ApiModelProperty(value = "发货时间")
    private LocalDateTime deliveryTime;

    @ApiModelProperty(value = "到达时间")
    private LocalDateTime arrivalTime;

    @ApiModelProperty(value = "收货时间")
    private LocalDateTime receiptTime;

    @ApiModelProperty(value = "取消时间")
    private LocalDateTime cancellationTime;

    @ApiModelProperty(value = "取消原因")
    private String cancellationReason;

    @ApiModelProperty(value = "订单模式，可选值：SingleUnit, MultiUnit, BigCustomer")
    private String mode;

    @ApiModelProperty(value = "起运地和目的地金额")
    private BigDecimal originDestinationPrice;

    @ApiModelProperty(value = "是否专票 0 ,1")
    private Integer isTicket;

    @ApiModelProperty(value = "是否回单 0 ,1")
    private Integer isReceipt;

    @ApiModelProperty(value = "是否代收货款 0 ,1")
    private Integer isCollecting;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "速度评价  fast, medium, slow")
    private String speedLevel;

}